import request from '@/utils/request'

//添加成员
export function addMember(member) {
    return request({
        url: `/band/addMember`,
        method: 'post',
        data: member
    })
}

//根据成员id查询成员
export function selectMember(id) {
    return request({
        url: `/band/selectMember/${id}`,
        method: 'get'
    })
}

//编辑成员
export function updateMember(member) {
    return request({
        url: `/band/updateMember`,
        method: 'put',
        data: member
    })
}


//删除成员
export function deleteMember(id) {
    return request({
        url: `/band/deleteMember/${id}`,
        method: 'delete',
    })
}

//更新乐队信息
export function updateBand(band) {
    return request({
        url: `/band/updateBand`,
        method: 'put',
        data: band
    })
}

//根据乐队id查询成员
export function selectMembers(bandId) {
    return request({
        url: `/band/getMemberByBandId/${bandId}`,
        method: 'get'
    })
}

//根据id查询乐队
export function selectBandById(id) {
    return request({
        url: `/band/getBandById/${id}`,
        method: 'get'
    })
}

//添加
export function addBand(band) {
    return request({
        url: `/band/add`,
        method: 'post',
        data: band
    })
}

//删除
export function deleteBand(id) {
    return request({
        url: `/band/remove/${id}`,
        method: 'delete'
    })
}

//分页条件查询
export function getBandListPage(userId, page, size, name) {
    return request({
        url: `/band/getBandListPage/${userId}/${page}/${size}`,
        method: 'get',
        params: { name }
    })
}

//查询所有乐队，添加专辑时用到
export function selectAll() {
    return request({
        url: `/band/selectAll`,
        method: 'get'
    })
}